<!doctype html>
<html class="no-js">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>中建五局第三建设有限公司</title>
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <!-- No Baidu Siteapp-->
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!-- Add to homescreen for Chrome on Android -->
    <meta name="mobile-web-app-capable" content="yes">

    <!-- Add to homescreen for Safari on iOS -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <meta name="msapplication-TileColor" content="#0e90d2">
    <link rel="stylesheet" href="css/amazeui.min.css">
    <link rel="stylesheet" href="css/app.css">
    <link rel="stylesheet" href="css/public2.css">
</head>

<body>
    <div class="header">
        <h1 style="text-align: center;padding: 1rem 0;margin: 0;">中建五局第三建设公司</h1>
    </div>
    <div class="content">
        <div class="am-slider am-slider-default" data-am-flexslider id="demo-slider-0">
            <ul class="am-slides">
                <li><img src="/upload/banner-img/111555.png" /></li>
                <li><img src="/upload/banner-img/111555.png" /></li>
                <li><img src="/upload/banner-img/111555.png" /></li>
            </ul>
        </div>
        <div class="show_data">
            <div class="am-u-sm-4">
                <a href="" id="creating-project">
                    <div class="data_block">
                        <p>在建项目</p>
                        <p class="creating-project"></p>
                    </div>
                </a>

            </div>
            <div class="am-u-sm-4">
                <a href="" id="checking-project">
                    <div class="data_block">
                         <p>正在审批</p>
                        <p class="checking-project"></p>
                    </div>
                </a>

            </div>
            <div class="am-u-sm-4">
                <a href="" id="checked-project">
                    <div class="data_block">
                        <p>审批完成</p>
                        <p class="checked-project"></p>
                    </div>
                </a>
            </div>
        </div>
    </div>
    <div class="line"></div>
    <div class="goods">
        <a class="purchase" href=""> <div class="goods_button"><img src="images/index_icon1.png">&nbsp; 物资采购<img style="float: right;height: 1.8rem;" src="images/shape.png"></div></a>
        <hr>
        <a  class="allocate" href=""><div class="goods_button"><img src="images/index_icon3.png">&nbsp; 物资调拨<img style="float: right;height: 1.8rem;" src="images/shape.png"></div></a>
        <hr>
        <a class="scrap" href=""><div class="goods_button"><img src="images/index_icon2.png">&nbsp; 物资报废<img style="float: right;height: 1.8rem;" src="images/shape.png"></div></a>
        <hr>
    </div>
    <div class="footer">
        <a class="first-page"><div class="am-u-sm-4"><img src="images/index_footer.png"><span>首页</span> </div></a>
        <a class="message"><div class="am-u-sm-4"><img src="images/message_footer.png"><span>消息</span></div></a>
        <a class="mine"><div class="am-u-sm-4"><img src="images/my_footer.png"><span>我的</span></div></a>
    </div>
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
    <!--     <script src="js/amazeui.ie8polyfill.min.js"></script> -->
    <script src="js/amazeui.min.js"></script>
    <script type="application/javascript">
        $(function() {
            var $slider = $('#demo-slider-0');
            var counter = 0;
            var getSlide = function() {
                counter++;
                return '<li><img src="http://s.amazeui.org/media/i/demos/bing-' +
                    (Math.floor(Math.random() * 4) + 1) + '.jpg" />' +
                    '<div class="am-slider-desc">动态插入的 slide ' + counter + '</div></li>';
            };
        });
    </script>
    <script type="application/javascript">
        $(document).ready(function(){
            function getQueryString(name) {

                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return unescape(r[2]); return null;
            }
            var oAccessToken = getQueryString('access-token');


            $.ajax({
                url:"/v1/banner/mains?access-token="+oAccessToken,
                type:'post',
                data:'',
                async:true,
                success:function(data){
                    if(data.status == 200){
                        $('.purchase').attr('href','./purchase.html?access-token='+oAccessToken)
                        $('.allocate').attr('href','./transform.html?access-token='+oAccessToken)
                        $('.scrap').attr('href','./delete.html?access-token='+oAccessToken)
                        $('.message').attr('href','./message.html?access-token='+oAccessToken)
                        $('.mine').attr('href','./my.html?access-token='+oAccessToken)
                        $('.first-page').attr('href','./main.html?access-token='+oAccessToken)
                        $('#creating-project').attr('href','./main.html?access-token='+oAccessToken)
                        $('#checking-project').attr('href','./main.html?access-token='+oAccessToken)
                        $('#checked-project').attr('href','./main.html?access-token='+oAccessToken)
                        var len = data.body.banner.length;
                        $('.creating-project').text(data.body.project_num+'个');
                        $('.checking-project').text(data.body.checking_num+'个');
                        $('.checked-project').text(data.body.checked_num+'个');

                        console.log( $("[data-thumb-alt]").length);
                        for(let i=0;i<len;i++){
                            $("li[data-thumb-alt] img").eq(i).attr('src',data.body.banner[i].image);
                        }
                        $(".am-slides img" ).eq(0).attr('src',data.body.banner[2].image);
                        $(".am-slides img" ).eq(4).attr('src',data.body.banner[0].image);
                    }
                },
                error:function(data){
                    if(data.status == 401){
                        window.location.href = './index.html';
                    }
                },
            });
        })
    </script>




</body>
</html>